package cn.humaohua.study.yanmo_design_pattern.ch13.v1;

public class Main {
    public static void main(String[] args) {
        // 构造主板
        MainBoardApi mainBoard = new GigaMainBoard();
        // 开机按钮（一端连到主板上）
        Command openCommand = new OpenCommand(mainBoard);
        // 创建机箱
        Box box = new Box();
        // 开机按钮（一端连到机箱上）
        box.setOpenCommand(openCommand);
        // 按下开机按钮
        box.openButtonPressed();

        System.out.println("------------ reset -------------");
        Command resetCommand = new ResetCommand(mainBoard);
        box.setResetCommand(resetCommand);

        box.resetButtonPressed();
    }
}
